<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
        <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
        <title>随手快递</title>
        <link rel="stylesheet" type="text/css" href="../../AUI/css/aui.css" />
        <link rel="stylesheet" type="text/css" href="../../font-awesome/css/font-awesome.min.css" />
        <style type="text/css">
        .aui-content {
        text-align: center;
        margin-top: 80px;
        }
        .aui-label {
            border-bottom: 1px solid #bfbfbf;
            background: transparent;
        }
        .aui-label input{
            text-align: center;
        }
        .sbtn {
            margin-top: 20px;
        }
        </style>
    </head>
    <body>
        <header class="aui-bar aui-bar-nav" id="aui-header">
            <a class="aui-btn aui-pull-left" tapmode onclick="history.back();">
                <span class="aui-iconfont aui-icon-left"></span>
            </a>
            <div class="aui-title">短信验证码登录</div>
            <div class="aui-btn aui-pull-right"></div>
        </header>
        <div class="aui-content ">
            <div><h3>已将验证码发至您的手机</h3>
                <div style="font-size: 14px;"><span id="time">60</span>s 后重新获取</div></div>
            <div class="aui-label"><input type="text" id="num"/></div>


            <div style="font-size: 14px;margin-top: 10px"><a href="login_usrpsw.html">使用其他方式登录</a></div>
            <div class="aui-btn aui-btn-success sbtn"style="width: 70%;height: 35px;line-height: 35px;background: rgb(40, 174, 161)" id="submit">提交</div>
        </div>

        <script type="text/javascript" src="../../myJs/jquery-1.12.1.min.js" ></script>
        <script src="../../myJs/jquery.cookie.js"></script>
        <script type="text/javascript" src="../../myJs/index.js" ></script>
        <script>
            var setTime;
            $(document).ready(function(){
                var time=parseInt($("#time").text());
                setTime=setInterval(function(){
                    if(time<=0){
                        clearInterval(setTime);
                        return;
                    }
                    time--;
                    $("#time").text(time);
                },1000);
            });

            $("#submit").on("click",function(){
                var num = $("#num").val();
                if(num==""){
                    alertmd("请输入验证码");
                    return false;
                }
               
                 $.ajax({
                 type: "post",
                 url: '/randomdelivery/userLoginController/loginMessage',
                 data: {
                	 security:num
                 },
                 datatype: "json",
                 success: function (data) {
                	 alert(JSON.stringify(data));
                	 sessionStorage.setItem("userId", data.msg.userId);
                	 location.href='../helpBuy/index.html'
                 }
                 

                 });
            })
        </script>
    </body>
</html>